package com.wanpinghui.supplier.user.company.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.wanpinghui.supplier.R;
import com.wanpinghui.wphlibrary.photovideo.bean.BaseUrlBean;
import com.yunshl.yunshllibrary.recyclerview.BaseRecyclerViewAdapter;

/**
 * Created by tg596 on 2018/1/29.
 */

public class BussinessCertificateAdapter extends BaseRecyclerViewAdapter<BaseUrlBean,BussinessCertificateAdapter.BussinessCertificateViewHolder> {

    public BussinessCertificateAdapter(Context context) {
        super(context);
    }

    @Override
    public BussinessCertificateViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_bussiness_certificate,parent,false);
        return new BussinessCertificateViewHolder(view);
    }

    @Override
    public void onBindViewHolder(BussinessCertificateViewHolder holder, int position) {
        super.onBindViewHolder(holder, position);

        Glide.with(context).load(datas.get(position).getThumbUrl1()).thumbnail(0.5f).placeholder(R.mipmap.loading_140x140).into(holder.image_view);

    }

    @Override
    public int getItemCount() {
        return datas == null ? 0 :datas.size();
    }

    class BussinessCertificateViewHolder extends ViewHolder {

        ImageView image_view;

        public BussinessCertificateViewHolder(View itemView) {
            super(itemView);
            image_view = (ImageView) itemView.findViewById(R.id.image_view);
        }
    }


}
